
package com.cmc.service.impl;

import java.util.List;

import com.cmc.service.impl.BaseManager;
import com.cmc.model.Company;
import com.cmc.dao.CompanyDao;
import com.cmc.service.CompanyManager;

public class CompanyManagerImpl extends BaseManager implements CompanyManager {
    private CompanyDao dao;

    /**
     * Set the Dao for communication with the data layer.
     * @param dao
     */
    public void setCompanyDao(CompanyDao dao) {
        this.dao = dao;
    }

    /**
     * @see com.cmc.service.CompanyManager#getCompanys(com.cmc.model.Company)
     */
    public List getCompanys(final Company company) {
        return dao.getCompanys(company);
    }

    /**
     * @see com.cmc.service.CompanyManager#getCompany(String id)
     */
    public Company getCompany(final String id) {
        return dao.getCompany(new Long(id));
    }

    /**
     * @see com.cmc.service.CompanyManager#saveCompany(Company company)
     */
    public void saveCompany(Company company) {
        dao.saveCompany(company);
    }

    /**
     * @see com.cmc.service.CompanyManager#removeCompany(String id)
     */
    public void removeCompany(final String id) {
        dao.removeCompany(new Long(id));
    }
}
